package com.ucar.train.dao;

import com.ucar.train.dto.MenuDTO;
import com.ucar.train.vo.Menu;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.Cacheable;

import java.util.List;

public interface MenuMapper {

//    @Cacheable(cacheNames = "menus")
    List<MenuDTO> getAllMenu();

//    @CacheEvict(cacheNames="menus",allEntries = true)
    Integer insertMenus(@Param("list") List<Menu> menus);

//    @CacheEvict(cacheNames="menus",allEntries = true)
    Integer deleteMenu(@Param("id") Long id);

//    @CacheEvict(cacheNames="menus",allEntries = true)
    Integer updateMenu(@Param("menu") Menu menu);

//    @Cacheable(value = "menu",key = "'menu'+#id")
    MenuDTO getMenuById(@Param("id") Long id);

    /**
     * 批量查询权限信息
     * auth:吴福强
     * @param menuIds
     * @return
     */
    List<MenuDTO> listMenusById(@Param("menuIds") List<Long> menuIds);


}
